package org.fuxian.dao;

import org.apache.ibatis.annotations.*;
import org.fuxian.domain.MySort;

import java.util.List;

public interface MySortMapper {
    @Select("select * from mysort where sid = #{sid}")
    public MySort findById(int sid);
    @Select("select * from mysort where sname = #{sname}")
    public MySort findByName(String sname);
    @Insert("insert into mysort values(null, #{sname})")
    public int add(String sname);
    @Update("update mysort set sname = #{sname} where sid = #{sid}")
    public int update(@Param("sname")String sname, @Param("sid")int sid);
    @Select("select * from mysort")
    public List<MySort> findAll();
    @Delete("DELETE FROM mysort WHERE sid=#{sid}")
    public int delete(@Param("sid")int sid);
}
